import com.cn.Mapper.goodsMapper.GoodsMapper;
import com.cn.Mapper.shopMapper.InventoryMapper;
import com.cn.entity.shop.Shop_GoodsInventory;
import com.cn.util.SqlsesstionUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

import java.util.List;

/**
 * @ClassName testInventory
 * @Description TODO
 * @Author yujiajing
 * @Date 2022/10/16 22:16
 * @Version 1.0
 */
public class testInventory {
    @Test
    public  void updateInventoryByCart(){
        SqlSession sqlSession= SqlsesstionUtil.getSqlSession();
       InventoryMapper inventoryMapper =sqlSession.getMapper(InventoryMapper.class);
       inventoryMapper.updateInventoryByCart();
    }
    @Test
    public  void showAll(){
        SqlSession sqlSession= SqlsesstionUtil.getSqlSession();
        InventoryMapper inventoryMapper =sqlSession.getMapper(InventoryMapper.class);
        List<Shop_GoodsInventory> shop_goodsInventoryList=inventoryMapper.showAll();
        System.out.println(shop_goodsInventoryList.toString());
    }
    @Test
    public  void AddInventoryById(){
        Integer goods_inventory=100;
        String goods_id="1";
        SqlSession sqlSession= SqlsesstionUtil.getSqlSession();
        InventoryMapper inventoryMapper =sqlSession.getMapper(InventoryMapper.class);
        inventoryMapper.addInventory(goods_inventory,goods_id);
    }
}
